package com.bawei.module_service.http

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class ServiceRepository @Inject  constructor(){
    //
    @Inject
    @ServiceNetModule.CommonServiceApi
    lateinit var api:ServiceApi

    //获取维修列表
    fun getMaintainList()= flow {
        emit(api.getMaintainList())
    }.flowOn(Dispatchers.IO)

    //获取巡逻列表
    fun getPatrolList()= flow{
        emit(api.getPatrolList())
    }.flowOn(Dispatchers.IO)


    //获取巡检列表
    fun getPollingList()= flow{
        emit(api.getPollingList())
    }.flowOn(Dispatchers.IO)

}